@startuml
title Схема доступа компонентов скриптов к объектам веб-страницы

  node "Browser" as BROWSER_NODE {
    folder "Active Tab" {
      component [content_script.js] as content_script
      frame "Web App" {
        component [inject_script.js] as inject_script
        component [webapp_script.js] as webapp_script
        frame "Page Environment" {
        frame "Local Page Environment" {
          component #FFAA99 [new InjectObject()] as inject_object
          component #FFAA99 [new WebAppObject()] as webapp_object
        }
        component #FFAA99 [new ContentObject()] as content_object
        }
      }
    }
  }

  webapp_script<-[#DD00DD]-> webapp_object
  webapp_script<-[#DD00DD]-> inject_object

  inject_script <-[#991530]-> webapp_object
  inject_script <-[#991530]-> inject_object

  content_script <-[#345ACF]-> content_object
  content_script <.[#345ACF].> inject_script

  note left of [content_script]
    Content Script имеет
    доступ к Inject Script как
    к HTML элементу на странице
    (отмечено пунктиром)
  end note
@enduml